package d0316;

public class StopSleepThread {
    public static void main(String[] args) {
        SleepThread SleepThread=new SleepThread();
        System.out.println("线程启动");
        SleepThread.start();
        SleepThread.interrupt();
    }
}
class SleepThread extends Thread{
boolean flag =true;
public void run(){
    while (flag){
        try{
            System.out.println("线程正在运行");
            sleep(1000*60);

        }catch(InterruptedException e){
            e.printStackTrace();
            System.out.println("线程中断");
            flag=false;
        }
    }
}
}